package problem;

public class Trapezia extends Shape{
    double top;
    double bottom;
    double high;

    public Trapezia(double top, double bottom, double high) {
        this.top = top;
        this.bottom = bottom;
        this.high = high;
    }

    @Override
    double getOutline() {
        return top + bottom + 2 * Math.sqrt( (Math.pow(high,2)+ Math.pow(bottom - top,2)) / 4);
    }


    @Override
    double getArea() {
        return (top + bottom) * high / 2;
    }
}
